#pragma once
#include <QObject>
#include <QPixmap>
#include <QNetworkAccessManager>
#include <QNetworkReply>

class m_urlTpl : public QObject {
    Q_OBJECT
public:
    explicit m_urlTpl(const QString &urlTemplate, QObject *parent = nullptr);
    void fetch(int z, int x, int y);
signals:
    void tileReady(int z, int x, int y, const QPixmap &pix);

private slots:
    void onFinished(QNetworkReply *reply);

private:
    QString m_tpl;
    QNetworkAccessManager m_mgr;
};
